import { message } from 'antd';
import { userInfo } from '../services/api';

export default {
	namespace: 'control',
	state: {
    userinfo:{},
    loading: false,
  },

  effects: {
  	*fetch({ payload }, { call, put }) {
  	
      const response = yield call(userInfo, payload);
      yield put({
        type: 'userinfo',
        payload: response,
      });
    },
  },

  reducers: {
    userinfo(state, action) {
      return {
        ...state,
        userinfo: action.payload.data,
      };
    },
  },
};